<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const o = { uname: "奉仙", age: 21 };
      // 获得所有的属性名
      console.log(Object.keys(o)); // 返回数组["uname","age"]
      // 获得所有的属性值
      console.log(Object.values(o)); // ["pick",18]
      // 对象拷贝
      // const oo = {}
      // Object.assign(oo, o)
      // console.log(oo)
      Object.assign(o, { gender: "男" });
      console.log(o);
    </script>
  </body>
</html>
